import request from '@/utils/request'
import { CHECC_API_CMS } from '@/constants/proxy'
import { exportMethod } from '@/utils/utils'

const getProductList = (params) => {
  return request.post(
    CHECC_API_CMS +
      `/xmzx/scheduleManagement/list?current=${params.current}&size=${params.size}&projectName=${params.projectName}`
  )
}
const syncContract = (params) => {
  return request.post(CHECC_API_CMS + `/xmzx/scheduleManagement/getContractOutputValue`, params)
}
const syncPackage = (params) => {
  return request.post(
    CHECC_API_CMS + `/xmzx/scheduleManagement/getScheduleSubpackageDetails`,
    params
  )
}
const syncCostControl = (params) => {
  return request.post(CHECC_API_CMS + `/xmzx/scheduleManagement/getIntelligentCostControl`, params)
}
const updateCostControl = (params) => {
  return request.post(CHECC_API_CMS + `/xmzx/scheduleManagement/update`,params)
}
const getDetailById = (params) => {
  return request.post(CHECC_API_CMS + `/xmzx/scheduleManagement/getDetailById?projectId=${params}`)
}
//导出
export function getExportExcel(data) {
  const params = {
    method: 'post',
    url: CHECC_API_CMS + '/xmzx/scheduleManagement/export',
    fileName: '经费管理列表',
    data: data,
  }
  return exportMethod(params)
}
export {
  getProductList,
  syncContract,
  syncPackage,
  syncCostControl,
  updateCostControl,
  getDetailById,
}
